﻿using System.Linq;
using System.Web.Mvc;
using System.Xml;
using WD.Db.Contract;
using WD.Db.Contract.Model;
using WD.Framework.Contract;
using WD.Web.MVC.Common;

namespace WD.Web.MVC.Areas.BaseArea.Controllers
{
    public class HomeController : AdminControllerBase
    {
        //
        // GET: /Manager/Home/
        public ActionResult Index(BaseRequest request)
        {
            if (LoginInfo.EnumLoginAccountType == (int)账户凭证类型.商家)
            {
                var doc = new XmlDocument();
                doc.Load(Server.MapPath("/Config/ComplexMenuFunctionID.xml"));    //加载Xml文件  
                var rootElem = doc.DocumentElement;   //获取根节点  
                if (rootElem != null)
                {
                    var personNodes = rootElem.GetElementsByTagName("menu"); //获取person子节点集合  
                    ViewBag.Menu = (from XmlNode node in personNodes select ((XmlElement)node).GetAttribute("id") into id select int.Parse(id)).ToList();
                }
            }
            return View();
        }
    }
}
